<?php
/*********************************************************************************
** The contents of this file are subject to the vtiger CRM Public License Version 1.0
 * ("License"); You may not use this file except in compliance with the License
 * The Original Code is:  vtiger CRM Open Source
 * The Initial Developer of the Original Code is vtiger.
 * Portions created by vtiger are Copyright (C) vtiger.
 * All Rights Reserved.
*
 ********************************************************************************/
$onlymine=$_REQUEST['onlymine'];
if($onlymine == 'true') {
    $mine_selected = ' selected="selected"';
    $all_selected = '';
} else {
    $mine_selected = '';
    $all_selected = ' selected="selected"';
}
?>
	<div class="left">
   	<span class="lvtHeaderText"><?php echo getTranslatedString('LBL_SERVICE');?></span>
   </div>
	<div class="right">
      <?php
      	$allow_all = $client->call('show_all',array('module'=>'Services'),$Server_Path, $Server_Path);
         if($allow_all == 'true') {
        		echo '<span class="show">' . getTranslatedString('SHOW') . '</span>
        		   <select name="list_type" onchange="getList(this, \'Services\');">
          			<option value="mine"' . $mine_selected . '>' . getTranslatedString('MINE') . '</option>
			         <option value="all"' . $all_selected . '>' . getTranslatedString('ALL') . '</option>
			      </select>' . "\n";
    		}
      ?>
 	</div>
</div><!-- End action -->
<?php
global $result;
global $client;

echo '<table class="list">' . "\n";

if ($customerid != '' )
{
   $block = 'Services';	
	$params = Array('id'=>$customerid,'module'=>$block,'sessionid'=>$sessionid,'onlymine'=>$onlymine);
	$result = $client->call('get_service_list_values', $params, $Server_Path, $Server_Path);
	if (count($result) == 1 && $result[0] == "#NOT AUTHORIZED#") {
		echo '<tr><td class="error">' . getTranslatedString('LBL_NOT_AUTHORISED') . '</td></tr>' . "\n";
		echo '</table>' . "\n";
		include("bottom.php");
		die();
	}
	echo getblock_fieldlistview_product($result,$block);
}

echo '</table>' . "\n";

?>